@extends('layout.admin')

@section('title')
<title>商品修改</title>
@endsection

@section('content')
@if(count($errors)>0)
<div class="alert alert-danger">
	出错啦哦!!!
	<button type="button" class="close" data-dismiss="alert">×</button>
	@foreach($errors->all() as $error)
	<strong>{{$error}}</strong>
	@endforeach
</div>
@endif
  <div class="row"> 
   <div class="col-xs-12"> 
    <div class="panel"> 
     <div class="panel-heading bk-bg-primary"> 
      <h6><i class="fa fa-indent red"></i>商品修改</h6> 
      <div class="panel-actions"> 
       <a class="btn-setting" href="#"><i class="fa fa-rotate-right black"></i></a> 
       <a class="btn-minimize" href="#"><i class="fa fa-chevron-up black"></i></a> 
       <a class="btn-close" href="#"><i class="fa fa-times black"></i></a> 
      </div> 
     </div> 
     <div class="panel-body bk-bg-white bk-padding-top-30 bk-padding-bottom-20"> 

      <form action="/goods/{{$goods->id}}" method="post" enctype="multipart/form-data" class="form-horizontal form-bordered"> 
       <div class="form-group"> 
        <label class="col-md-3 control-label">商品名称</label> 
        <div class="col-md-6"> 
         <div class="input-group"> 
          <span class="input-group-addon"> <i class="fa fa-comment-o"></i> </span> 
          <input class="form-control" type="text" name="title" value="{{$goods['title']}}" placeholder="商品名称"/> 
         </div> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label class="col-md-3 control-label">价格</label> 
        <div class="col-md-6 control-label"> 
         <div class="input-group"> 
          <span class="input-group-addon"> <i class="fa fa-cny"></i> </span> 
          <input class="form-control" type="text" name="price" value="{{$goods['price']}}" /> 
         </div> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label class="col-md-3 control-label">商品原价</label> 
        <div class="col-md-6 control-label"> 
         <div class="input-group"> 
          <span class="input-group-addon"> <i class="fa fa-cny"></i> </span> 
          <input class="form-control" type="text" name="oldprice" value="{{$goods['oldprice']}}"/> 
         </div> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="fc_inputmask_1" class="col-md-3 control-label">规格</label> 
        <div class="col-md-9"> 
          <div class="radio-custom radio-inline">
			     <input type="radio" value="16G" name="size[]" @if($goods['size']==16) checked @endif> 
		    <label for="inline-radio1">16G</label>
		  </div>
          <div class="radio-custom radio-inline">
			<input type="radio" value="32G" name="size[]" @if($goods['size']==32) checked @endif> 
		    <label for="inline-radio1">32G</label>
		  </div>
		  <div class="radio-custom radio-inline">
			<input type="radio" value="64G" name="size[]" @if($goods['size']==64) checked @endif> 
		    <label for="inline-radio1">64G</label>
		  </div>
		  <div class="radio-custom radio-inline">
			<input type="radio" value="128G" name="size[]" @if($goods['size']==128) checked @endif> 
		    <label for="inline-radio1">128G</label>
		  </div>
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="fc_inputmask_1" class="col-md-3 control-label">库存</label> 
        <div class="col-md-6"> 
         <div class="input-group"> 
          <span class="input-group-addon"> <i class="fa fa-archive"></i> </span> 
          <input class="form-control" placeholder="" type="text" name="kucun" value="{{$goods['kucun']}}" /> 
         </div> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="fc_inputmask_1" class="col-md-3 control-label">颜色</label> 
        <div class="col-md-9"> 
          <div class="checkbox-custom checkbox-inline">
			      <input type="checkbox" value="红色" name="color[]" @if($goods['color']=="红色") checked @endif> 
		    <label for="inline-radio1">红色</label>
		  </div>
		  <div class="checkbox-custom checkbox-inline">
			     <input type="checkbox" value="玫瑰金" name="color[]" @if($goods['color']=="玫瑰金") checked @endif> 
		    <label for="inline-radio1">玫瑰金</label>
		  </div>
		  <div class="checkbox-custom checkbox-inline">
			     <input type="checkbox" value="白色" name="color[]"
           @if($goods['color']=="白色") checked @endif> 
		    <label for="inline-radio1">白色</label>
		  </div>
		  <div class="checkbox-custom checkbox-inline">
			    <input type="checkbox" value="粉色" name="color[]"
          @if($goods['color']=="粉色") checked @endif> 
		    <label for="">粉色</label>
		  </div>
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="fc_inputmask_1" class="col-md-3 control-label">商品图片</label> 
        <div class="col-md-6"> 
         <div class="input-group"> 
          <input type="file" name="img[]" multiple/> 
         </div> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="fc_inputmask_1" class="col-md-3 control-label">商品详情</label> 
        <div class="col-md-6"> 
         <!-- <div class="input-group">  -->
          <script id="container" name="detail" style="width:700px;height:200px;"type="text/plain">{{$goods['detail']}}</script>
         <!-- </div>  -->
        </div> 
       </div> 
       <!-- 配置文件 -->
       <script type="text/javascript" src="/admins/ueditor/ueditor.config.js"></script>
       <!-- 编辑器源码文件 -->
       <script type="text/javascript" src="/admins/ueditor/ueditor.all.js"></script>
       <script>
       		var ue = UE.getEditor('container',{
       			toolbars:[
       				['fullscreen','source','undo','redo','bold','simpleupload','forecolor','backcolor','fontfamily','fontsize','link','unlink','underline','italic','strikethrough','formatmatch','removeformat','inserttable','imagecenter','justifyleft','justifycenter','emotion','map','gmap','isertvideo','lineheight','edittip','scrawl','music','charts']
       			]
       		});

       </script>


		<div class="form-group">
		 <label class="col-md-3 control-label"></label>
			<div class="col-md-6 col-xs-11">
				{{csrf_field()}}
        <input type="hidden" name="_method" value="put">
				<button type="submit" class="btn btn-sm btn-info">修改</button>
				<button type="submit" class="btn btn-sm btn-danger">重置</button>
			</div>
		</div>
      </form> 
     </div> 
    </div> 
   </div> 
  </div>
 </body>
</html>



@endsection

